PURPOSE

library(plotly)
library(ggplot2)
library(ggvis)
library(googleVis)
library(rCharts)

EXAMPLES

1. ggplot2

Pros

  • super-control over plot features and format
  • uses grammar of graphics
  • lots of usage and support
  • good skill level already attained, with lots of home-made examples

Cons

  • no further ‘official’ development - basically abandoned in favour of ggvis
  • no built-in interactivity
  • can be cumbersome code
  • can’t easily download

Use

  • static charts, including R Markdown HTML files
  • maybe with Shiny, but probably choose alternatives below

2. ggvis

Pros

  • designed for more interactivity than ggplot2 (although require shiny)
  • defaults to cleaner style than ggplot2
  • takes advantage of pipe (%>%) and integrates with dplyr
  • easy export/download

Cons

  • interactivity requires Shiny

Use

  • in shiny apps

3. Plotly

Pros

  • full-on library of interactive charts
  • can embed charts with some interactivity in R Markdown HTML files

Cons

  • interactivity is limited to zooming, hover labels (which is cool but not sufficient)
  • for shiny, requires library on shiny server - compatible version
  • recent update (v4.0) not backwards compatible, breaking older charts

Use

  • embed in R Markdown HTML for limited interactivity
  • possibly with shiny

4. Google Viz

Pros

  • Well-developed Google chart library
  • Basic interaction (hover labels, item selection) built-in

Cons

  • displays in browser only, not R plot window or R Viewer
  • doesn’t directly integrate with R Markdown HTML docs - can be fidgetly to get it to work, only then it only displays in browser - not R Markdown preview
  • various charts may have limited customization options for presentation

Use

  • further research but could work in R Markdown docs AND shiny

5. rCharts

Pros

  • collection of chart libraries, including rPlot that is inspired by ggplot2-style
  • works well with R Markdown
  • basic interactivity (hover labels)

Cons

  • the chart libraries may not be super-flexible, in terms of available presentation options
  • not super-thorough documentation
  • more complex interactions may required Javascript coding

Use

  • tbd with more research but could work for R Markdown and shiny
  • (similar to Google Vis)

Conclusion